<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta name="description" content="长沙市妇幼医院">
    <title>长沙市健康民生项目</title>
    <script src="./js/jquery.min.js"></script>
    <script src="js/jweixin-1.2.0.js" type="text/javascript" charset="utf-8"></script>
    <style>
        html,body{
            height: 100%;
        }
        body,p,ul{
            margin: 0;
            padding: 0;
        }
        .reportHead{
            font-size:24px;
            color:#07b8dd;
            text-align:center;
            padding: 10px 0 10px 0;
            background: #dfdfdf;
        }
        .myReport{
            margin-left: 15px;
            font-size: 14px;
        }
        .myReport li{
            list-style-type: none;
            border-bottom: 1px solid #dfdfdf;
        }
        .myReport li a{
            display: block;
            width: 100%;
            text-decoration:none;
            display: flex;
            font-size: 16px;
            color: #000;
            padding: 5px 0;
        }
        .myReport li:first-child{
            padding: 10px 0;
            text-align: center;
        }
        /*.myReport li:last-child{*/
            /*border: none;*/
        /*}*/
        .myReport li a div{
            flex: 1;
        }
        .myReport li a div span{
            display: block;
        }
        .myReport li a div .reportName{
            font-size: 16px;
        }
        .myReport li a div .reportSample{
            font-size: 14px;
            margin-right: 15px;
        }
        .myReport li a div .reportTime{
            font-size: 12px;
        }

        .noData{
            width:100%;
            line-height: 300px;
            position:relative;
            top:40%;
            display: none;
            text-align: center;
            font-size:16px;
        }
        #goReport{
            height: 100%;
            position: relative;
        }
        #goReport #reportFooter{
            position: absolute;
            width:100%;
            left: 0;
            top:50px;
            bottom:0;
        }
        #goReport #reportFooter div{
            width: 100%;
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
        }
        #goReport #reportFooter div a{
            display: block;
            margin: 0 auto;
            text-decoration:none;
            width: 90%;
            height: 160px;
            line-height: 160px;
            text-align: center;
            color: #fff;
            font-size: 30px;
            background: #337ab7;
            border-radius: 5px;
        }
        #goReport #reportFooter div #ribbon{
            margin-top: 30px;
        }
        #reportSeach{
            padding: 0 20px;
        }
        #reportSeach .reportSeach-head{
            height: 50px;
            line-height: 50px;
            font-size: 24px;
            color: #337ab7;
            border-bottom: 1px solid #ccc;
            margin-top: 10px;
        }
        #reportSeach .redioDiv{
            height: 28px;
            margin-top: 40px;
            font-size: 20px;
            display: flex;
            align-items: center;
        }
        #reportSeach .redioDiv .radioChoose{
            width: 20px;
            height: 20px;
            border: 1px solid #ccc;
            border-radius: 20px;
            margin-right: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #reportSeach .redioDiv .radioChoose .radioSon{
            background: #337ab7;
            display: inline-block;
            width: 13px;
            height: 13px;
            border-radius: 13px;
            display: none;
        }
        #reportSeach #seachButten{
            background: #337ab7;
            height: 50px;
            line-height: 50px;
            font-size: 20px;
            color: #fff;
            text-align: center;
            border-radius: 5px;
            margin-top: 60px;
        }
        .bsInfo li{
            height: 50px;
            line-height: 50px;
            margin: 0 15px;
            list-style-type: none;
            font-size: 14px;
        }
        .bsInfo li .goBack{
            font-weight: normal;
            font-size: 14px;
            color: #337ab7;
            float: left;
        }
        .bsInfo li:first-child{
            font-size: 16px;
            text-align: center;
            font-weight: bolder;
        }
        .bsInfo li .bsInfo-left{
            display: inline-block;
            width: 130px;
        }
        .bsInfo li .bsInfo-right{
            margin-left: 20px;
        }
    </style>
</head>
<script type="text/javascript">
    $(document).ready(function(){
        $.ajax({
            type:"post",
            url:"/csfy/wx/getWxConfig.do",
            data:{
                url:window.location.href
            },
            success : function(data) {
                var getData = JSON.parse(data);
                var appId = getData.appId;
                var timestamp = getData.timestamp;
                var nonceStr = getData.nonceStr;
                var signature = getData.signature;
                wx.config({
                    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                    appId: appId, // 必填，公众号的唯一标识
                    timestamp: timestamp, // 必填，生成签名的时间戳
                    nonceStr: nonceStr, // 必填，生成签名的随机串
                    signature: signature,// 必填，签名
                    jsApiList: ['previewImage'] // 必填，需要使用的JS接口列表
                });
                //获取报告列表
                $.ajax({
                    type:"post",
                    url:"/csfy/wx/getSamplesReslut.do",
                    data:{},
                    success : function(data) {
                        var getData = JSON.parse(data);
                        if(getData.code == 200){
                            if(getData.rows == null){
                                $(".yichu").text(0);
                                $(".weichu").text(0);
                                $(".noData").show();
                            }else {
                                if(getData.rows.msg == undefined){
                                    var liHtml = "";
                                    $(".yichu").text(getData.rows.resultNum);
                                    $(".weichu").text((getData.rows.total - getData.rows.resultNum));
                                    //华大报告
                                    if(getData.rows.sampleList.length > 0){
                                        for(var i=0;i<getData.rows.sampleList.length;i++){
                                            liHtml += '<li><a href="' + getData.rows.sampleList[i].sampleReport + '">' +
                                                    '<div class="div-left"><span class="reportName">' + getData.rows.sampleList[i].viewProductName +
                                                    '</span><span class="reportSample">' + getData.rows.sampleList[i].sampleResult +
                                                    '</span></div><div class="div-right"><span class="reportTime">' + getData.rows.sampleList[i].getDate + ' ' + getData.rows.sampleList[i].getTime +
                                                    '</span></div></a></li>'
                                        }
                                    }
                                    //博圣报告
                                    if(getData.rows.sampleBSList.length > 0){
                                        for(var i=0;i<getData.rows.sampleBSList.length;i++){
                                            liHtml += '<li><a onclick="sampleBSinfo(' + "'" + getData.rows.sampleBSList[i].pheResult + "'" + ',' + "'" + getData.rows.sampleBSList[i].tshResult + "'" + ',' + "'" + getData.rows.sampleBSList[i].ohpResult + "'" + ',' + "'" + getData.rows.sampleBSList[i].msmsResult + "'" + ',' + "'" + getData.rows.sampleBSList[i].g6pdResult + "'" + ')">' +
                                                    '<div class="div-left"><span class="reportName">' + getData.rows.sampleBSList[i].productName +
                                                    '</span><span class="reportSample">' + getData.rows.sampleBSList[i].resultAll +
                                                    '</span></div><div class="div-right"><span class="reportTime">' + getData.rows.sampleBSList[i].resultTime +
                                                    '</span></div></a></li>'
                                        }
                                    }
                                    //产筛报告
                                    if(getData.rows.sampleCSList.length > 0){
                                        for(var i=0;i<getData.rows.sampleCSList.length;i++){
                                            liHtml += '<li><a>' +
                                                    '<div class="div-left"><span class="reportName">' + '产前血清学筛查' +
                                                    '</span><span class="reportSample">' +'T18结果:'+ getData.rows.sampleCSList[i].t18Result +',T21结果:'+ getData.rows.sampleCSList[i].t21Result+',NTD结果:'+ getData.rows.sampleCSList[i].ntdResult+
                                                    '</span></div><div class="div-right"><span class="reportTime">' + getData.rows.sampleCSList[i].resultTime +
                                                    '</span></div></a></li>'
                                        }
                                    }
                                    $(".myReport").append(liHtml);
                                }else {
                                    $(".reportInfo").html(getData.rows.msg);
                                }
                            }
                        }else {
                            alert(getData.msg);
                        }
                    },
                    error:function (res) {
                        alert("系统异常");
                    }
                });
            }
        });
    });
    //选项
    var radioChooseNum = 0;
    function radioChoose(num) {
        radioChooseNum = num;
        if(num == 1){
            $(".lively").show();
            $(".ribbon").hide();
        }else if(num == 2){
            $(".lively").hide();
            $(".ribbon").show();
        }
    }
    //查询跳转
    function goUrl() {
        if(radioChooseNum == 0){
            alert("请选择查询报告类型");
        }else if(radioChooseNum == 1){
            $("#reportSeach").hide();
            $("#livelihood").show();
        }else if(radioChooseNum == 2){
            window.location.href = "http://wechat.canseq.cn/wechat/login/";
        }
    }
    //博圣新筛报告详情
    function sampleBSinfo(phe,tsh,ohp,msms,g6pd) {
        $(".phe").text(phe);
        $(".tsh").text(tsh);
        $(".ohp").text(ohp);
        $(".msms").text(msms);
        $(".g6pd").text(g6pd);
        $(".bsInfo").show();
        $("#livelihood").hide();
    }
    //新筛报告详情返回
    function goBack() {
        $(".bsInfo").hide();
        $("#livelihood").show();
    }
</script>
<body>
    <div id="reportSeach">
        <div class="reportSeach-head">报告查询</div>
        <div class="redioDiv">
            <span class="radioChoose" onclick="radioChoose(1)"><span class="lively radioSon"></span></span>民生项目报告
        </div>
        <div class="redioDiv">
            <span class="radioChoose" onclick="radioChoose(2)"><span class="ribbon radioSon"></span></span>两癌报告
        </div>
        <div id="seachButten" onclick="goUrl()">查　询</div>
    </div>
    <div id="livelihood" style="display: none">
        <p class="reportHead">我的报告</p>
        <ul class="myReport">
            <li class="reportInfo">
                已出报告<span class="yichu"> </span>份，正在检测中<span class="weichu"> </span>份
            </li>
        </ul>
        <div class="noData">暂无检测报告</div>
    </div>
    <ul class="bsInfo" style="display: none">
        <li><span class="goBack" onclick="goBack()">＜返回</span>新生儿疾病筛查结果</li>
        <li>
            <span class="bsInfo-left">PHE检测结果：</span>
            <span class="bsInfo-right phe"></span>
        </li>
        <li>
            <span class="bsInfo-left">TSH检测结果：</span>
            <span class="bsInfo-right tsh"></span>
        </li>
        <li>
            <span class="bsInfo-left">OHP筛查结论：</span>
            <span class="bsInfo-right ohp"></span>
        </li>
        <li>
            <span class="bsInfo-left">G6PD检测结果：</span>
            <span class="bsInfo-right g6pd"></span>
        </li>
        <li>
            <span class="bsInfo-left">MSMS检测结果：</span>
            <span class="bsInfo-right msms"></span>
        </li>
    </ul>
</body>

</html>